package org.jeeasy.generate.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.dromara.mpe.annotation.InsertUpdateFillData;
import org.dromara.mpe.autotable.annotation.Column;
import org.dromara.mpe.autotable.annotation.Table;
import org.jeeasy.common.core.annotation.dict.Dict;
import org.jeeasy.common.core.base.BaseEntity;
import org.jeeasy.common.core.handler.SysOrgCodeAutoFillHandler;
import org.jeeasy.generate.emuns.IndexTypeEnum;

import java.io.Serial;
import java.io.Serializable;

/**
 * 代码生成 表索引
 *
 * @author AlpsDDJ
 * @since 2021-01-14 13:52:05
 */
@Data
@Table(value = "gen_table_index", comment = "表索引")
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class GenTableIndex extends BaseEntity<GenTableIndex> implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 表ID
     */
    @Column(comment = "表ID", length = 24)
    private String tableId;

    /**
     * 索引名称
     */
    @Column(comment = "索引名称", length = 32)
    private String indexName;

    /**
     * 索引字段
     */
    @Column(comment = "索引字段", length = 32)
    private String indexFields;

    /**
     * 索引类型
     */
    @Column(comment = "索引类型", length = 32)
    @Dict(dictEnum = IndexTypeEnum.class)
    private String indexType;

    /**
     * 所属部门
     */
    @Column(comment = "所属部门", length = 255)
    @InsertUpdateFillData(SysOrgCodeAutoFillHandler.class)
    private String sysOrgCode;
}
